class JQuery_oop {

    //判断是否是数字
    is_number(value){
        if(!isNaN(value)){
            return true;
        }else{
            return false;
        }
    }
    //获取JSON长度
    jsonlenth(value) {
        var size = 0;
        var key;
        for (key in value) {
            if (value.hasOwnProperty(key))
                size++;
        }
        return size;
    }
    hiding(object){
        for (let i = 0; i < object.length; i++) {
            object[i].style.display = "none"
        }
    }
    //判断目前是上午还是下午
    date(){
        let getTimeState = () => {
            // 获取当前时间
            let timeNow = new Date();
            // 获取当前小时
            let hours = timeNow.getHours();
            // 设置默认文字
            var text = "";
            // 判断当前时间段
            if (hours >= 0 && hours <= 10) {
                text = "早上好";
            } else if (hours > 10 && hours <= 14) {
                text = "中午好";
            } else if (hours > 14 && hours <= 18) {
                text = "下午好";
            } else if (hours > 18 && hours <= 24) {
                text = "晚上好";
            }
            var date = document.getElementsByClassName("date");
            date[0].innerText = text
            // 返回当前时间段对应的状态
            return text;
        };
        getTimeState();
    }
}